package com.ourteam.product.ui.domain;
/**
 * Template Name : DTO数据对象 Template Version : 1 Template Last Modfiy Date : Fri Nov 30 16:49:33 CST
 * 2018 Auto Generate Date : 2018-12-14 15:16:18 Warning ! This file will be overwrite when
 * regenerate !
 */
import java.util.HashMap;
import java.util.Map;
import net.dao.IDataPopulateCallback;
import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.lang.ArrayUtils;

public class ProductUITreeNodeBean implements java.io.Serializable {

  private static Map<String, String> mappedDaoFields = new HashMap<String, String>();

  private com.ourteam.product.ui.dao.ProductUITreeNode productUITreeNode;

  protected BeanMap getBeanMap() {

    return new BeanMap(productUITreeNode);
  }

  static {
    mappedDaoFields.put("id", com.ourteam.product.ui.dao.IProductUITreeNodeDAO.Id);

    mappedDaoFields.put("treeId", com.ourteam.product.ui.dao.IProductUITreeNodeDAO.TreeId);

    mappedDaoFields.put("code", com.ourteam.product.ui.dao.IProductUITreeNodeDAO.Code);

    mappedDaoFields.put("title", com.ourteam.product.ui.dao.IProductUITreeNodeDAO.Title);

    mappedDaoFields.put("titleKey", com.ourteam.product.ui.dao.IProductUITreeNodeDAO.TitleKey);

    mappedDaoFields.put("icon", com.ourteam.product.ui.dao.IProductUITreeNodeDAO.Icon);

    mappedDaoFields.put("isLeaf", com.ourteam.product.ui.dao.IProductUITreeNodeDAO.IsLeaf);

    mappedDaoFields.put(
        "lastModifyUser", com.ourteam.product.ui.dao.IProductUITreeNodeDAO.LastModifyUser);

    mappedDaoFields.put(
        "lastModifyTime", com.ourteam.product.ui.dao.IProductUITreeNodeDAO.LastModifyTime);

    mappedDaoFields.put("status", com.ourteam.product.ui.dao.IProductUITreeNodeDAO.Status);

    mappedDaoFields.put("remarks", com.ourteam.product.ui.dao.IProductUITreeNodeDAO.Remarks);

    mappedDaoFields.put("isRoot", com.ourteam.product.ui.dao.IProductUITreeNodeDAO.IsRoot);
  }

  public static String getMappedDAOField(String aAttrName) {
    return mappedDaoFields.get(aAttrName);
  }

  public ProductUITreeNodeBean() {
    super();

    this.productUITreeNode = new com.ourteam.product.ui.dao.ProductUITreeNode();
  }

  public ProductUITreeNodeBean(com.ourteam.product.ui.dao.ProductUITreeNode productUITreeNode) {
    super();

    this.productUITreeNode = productUITreeNode;
  }

  public com.ourteam.product.ui.dao.ProductUITreeNode convertToProductUITreeNode() {
    return this.productUITreeNode;
  }

  public com.ourteam.product.ui.dao.ProductUITreeNode convertTo() {
    return this.productUITreeNode;
  }

  /**
   * Get id
   *
   * @return long
   */
  public long getId() {
    return (long) this.productUITreeNode.getId();
  }

  /**
   * Set id
   *
   * @parameter long
   */
  public void setId(long id) {

    this.productUITreeNode.setId(id);
  }

  /**
   * Get treeId
   *
   * @return long
   */
  public long getTreeId() {
    return (long) this.productUITreeNode.getTreeId();
  }

  /**
   * Set treeId
   *
   * @parameter long
   */
  public void setTreeId(long treeId) {

    this.productUITreeNode.setTreeId(treeId);
  }

  /**
   * Get code
   *
   * @return String
   */
  public String getCode() {
    return (String) this.productUITreeNode.getCode();
  }

  /**
   * Set code
   *
   * @parameter String
   */
  public void setCode(String code) {

    this.productUITreeNode.setCode(code);
  }

  /**
   * Get title
   *
   * @return String
   */
  public String getTitle() {
    return (String) this.productUITreeNode.getTitle();
  }

  /**
   * Set title
   *
   * @parameter String
   */
  public void setTitle(String title) {

    this.productUITreeNode.setTitle(title);
  }

  /**
   * Get titleKey
   *
   * @return String
   */
  public String getTitleKey() {
    return (String) this.productUITreeNode.getTitleKey();
  }

  /**
   * Set titleKey
   *
   * @parameter String
   */
  public void setTitleKey(String titleKey) {

    this.productUITreeNode.setTitleKey(titleKey);
  }

  /**
   * Get icon
   *
   * @return String
   */
  public String getIcon() {
    return (String) this.productUITreeNode.getIcon();
  }

  /**
   * Set icon
   *
   * @parameter String
   */
  public void setIcon(String icon) {

    this.productUITreeNode.setIcon(icon);
  }

  /**
   * Get isLeaf
   *
   * @return String
   */
  public String getIsLeaf() {
    return (String) this.productUITreeNode.getIsLeaf();
  }

  /**
   * Set isLeaf
   *
   * @parameter String
   */
  public void setIsLeaf(String isLeaf) {

    this.productUITreeNode.setIsLeaf(isLeaf);
  }

  /**
   * Get lastModifyUser
   *
   * @return String
   */
  public String getLastModifyUser() {
    return (String) this.productUITreeNode.getLastModifyUser();
  }

  /**
   * Set lastModifyUser
   *
   * @parameter String
   */
  public void setLastModifyUser(String lastModifyUser) {

    this.productUITreeNode.setLastModifyUser(lastModifyUser);
  }

  /**
   * Get lastModifyTime
   *
   * @return java.util.Date
   */
  public java.util.Date getLastModifyTime() {
    return (java.util.Date) this.productUITreeNode.getLastModifyTime();
  }

  /**
   * Set lastModifyTime
   *
   * @parameter java.util.Date
   */
  public void setLastModifyTime(java.util.Date lastModifyTime) {

    this.productUITreeNode.setLastModifyTime(lastModifyTime);
  }

  /**
   * Get status
   *
   * @return String
   */
  public String getStatus() {
    return (String) this.productUITreeNode.getStatus();
  }

  /**
   * Set status
   *
   * @parameter String
   */
  public void setStatus(String status) {

    this.productUITreeNode.setStatus(status);
  }

  /**
   * Get remarks
   *
   * @return String
   */
  public String getRemarks() {
    return (String) this.productUITreeNode.getRemarks();
  }

  /**
   * Set remarks
   *
   * @parameter String
   */
  public void setRemarks(String remarks) {

    this.productUITreeNode.setRemarks(remarks);
  }

  /**
   * Get isRoot
   *
   * @return String
   */
  public String getIsRoot() {
    return (String) this.productUITreeNode.getIsRoot();
  }

  /**
   * Set isRoot
   *
   * @parameter String
   */
  public void setIsRoot(String isRoot) {

    this.productUITreeNode.setIsRoot(isRoot);
  }

  public int hashCode() {
    return org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(this);
  }

  public boolean equals(Object obj) {
    if (obj == null) {
      return false;
    } // end if

    if ((obj instanceof ProductUITreeNodeBean) == false) {
      return false;
    } // end if

    ProductUITreeNodeBean other = (ProductUITreeNodeBean) obj;

    boolean isEqual = false;

    com.ourteam.product.ui.dao.ProductUITreeNode tempProductUITreeNode =
        other.convertToProductUITreeNode();

    if (tempProductUITreeNode == null || this.productUITreeNode == null) {
      isEqual = false;
    } else if (tempProductUITreeNode == this.productUITreeNode
        || tempProductUITreeNode.equals(this.productUITreeNode)) {
      isEqual = true;
    } else {
      isEqual = false;
    }

    return isEqual;
  }

  public static ProductUITreeNodeBean[] toArray(
      com.ourteam.product.ui.dao.ProductUITreeNode[] aProductUITreeNodes) {

    return toArray(aProductUITreeNodes, null);
  }

  public static ProductUITreeNodeBean[] toArray(
      com.ourteam.product.ui.dao.ProductUITreeNode[] aProductUITreeNodes,
      IDataPopulateCallback aCallBack) {

    if (ArrayUtils.isEmpty(aProductUITreeNodes)) {
      return new ProductUITreeNodeBean[0];
    }

    int length = aProductUITreeNodes.length;

    ProductUITreeNodeBean[] beans = new ProductUITreeNodeBean[length];

    for (int i = 0; i < length; i++) {
      beans[i] = new ProductUITreeNodeBean(aProductUITreeNodes[i]);
      if (aCallBack != null) {
        aCallBack.populate(beans[i], new Object[] {aProductUITreeNodes[i]});
      }
    }

    return beans;
  }
}
